package com.example.fragmenttest.Bean;

import org.litepal.annotation.Column;
import org.litepal.crud.LitePalSupport;

public class User extends LitePalSupport {
    int id ;

    @Column(unique=true,defaultValue = "unknown")//加入该方法后记得改版本号

//   添加注释，用户名不再重复
//unique：独一无二的
    String name ;
    String password ;
    int permission=1 ; // 初始值唯 1 默认为用户
    public User() {
    }

    public User(int id, String name, String password) {
        this.id = id;
        this.name = name;
        this.password = password;
    }

    public User(int id, String name, String password, int permission) {
        this.id = id;
        this.name = name;
        this.password = password;
        this.permission = permission;
    }

    public int getPermission() {
        return permission;
    }

    public void setPermission(int permission) {
        this.permission = permission;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
